﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YieldReturn
{
    class Yield
    {
        private int k;
        public Yield()
        {
            k = 1;
        }

        public IEnumerator<int> GetEnumerator()
        {
            for (int i = 0; i < 100; i++)
                yield return i * k;
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Yield y = new Yield();
            foreach (var c in y)
            {
                Console.WriteLine(c.ToString());
            }
        }
    }
}
